/*
 * @Description: file content
 * @Author: oooh
 * @Date: 2024-05-15 11:15:02
 * @LastEditors: oooh
 * @LastEditTime: 2024-08-05 15:31:58
 * @FilePath: \Civil_Servant_Performance_PC\src\mixins\index.js
 */
export const mixins = {
  data() {
    return {
      limit: 5,
      fileSize: 5,
      fileType: ['docx', 'xlsx', 'ppt', 'pdf', 'png', 'jpg']
    }
  },
  methods: {
    // 格式化文件路径
    formatFileUrl(path) {
      // 获取最后一个斜杠后面的字符
      const lastIndex = path.lastIndexOf('/')
      let name = path.substring(lastIndex + 1)

      // 获取最后一个点号后面的字符
      const dotIndex = name.lastIndexOf('.')
      let type = name.substring(dotIndex + 1)
      return { name, type }
    }
  }
}
